fix(credmgmt): Yubikey error when NextCred is not handled statefully#264
Merged
AlfioEmanueleFresta merged 3 commits intoJun 10, 2026
Merged
Conversation
b24d2fd to
71b22b8
Compare
AlfioEmanueleFresta
approved these changes
Jun 10, 2026
AlfioEmanueleFresta
left a comment
Member
There was a problem hiding this comment.
Thanks for the fix and the clear diagnosis @Nisker, you read the spec exactly right.
- CTAP 2.1 §6.8.3 and §6.8.4 send the GetNext subcommands with only the subCommand parameter.
- The stateful commands section lets authenticators fail a continuation with CTAP2_ERR_NOT_ALLOWED unless it directly follows Begin or another GetNext.
- Our old loop broke this in two ways. It attached a pinUvAuthParam, and it sent a getInfo between Begin and GetNext.
- YubiKeys enforce the strict reading, the Token2 is lenient.
- libfido2, Chromium and python-fido2 all send GetNext bare.
Reproduced here on a YubiKey with two passkeys under one RP. On master:
DEBUG user_verification:ctap2_get_info: CTAP2 GetInfo successful
TRACE ctap2_credential_management: request=Ctap2CredentialManagementRequest {
subcommand: Some(EnumerateCredentialsGetNextCredential), subcommand_params: None,
protocol: Some(Two), uv_auth_param: Some([155, 189, 175, ..]) }
DEBUG ctap2_credential_management: Received CBOR response status=NotAllowed
Error: Ctap(NotAllowed)
With this PR, same device and credentials:
TRACE ctap2_credential_management: request=Ctap2CredentialManagementRequest {
subcommand: Some(EnumerateCredentialsGetNextCredential), subcommand_params: None,
protocol: None, uv_auth_param: None }
DEBUG ctap2_credential_management: Received CBOR response status=Ok
DEBUG ctap2_credential_management: CTAP2 CredentialManagement successful
I pushed two commits on top of your branch:
- Regression tests pinning the wire format. They fail on master.
- A fix for authenticators that only advertise credentialMgmtPreview. Begin resolves the 0x41 preview command from getInfo, but GetNext no longer went through that path, so it would have gone out as 0x0A. Begin now records the command set it resolved and GetNext reuses it.
Nice catch, thanks again!
5294ac7
into
linux-credentials:master
4 checks passed
Member
|
This is now released in libwebauthn 0.7.1 if you want to test, thanks again @Nisker! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have a Token2 and a Yubikey "Security Key C NFC".
The Yubikey is more strict than the Token2 and causes errors.
cargo run --example cred_management_hidwith option 2: "(2) Enumerate credentials"causes
Error: Ctap(NotAllowed)on the Yubikey after the PIN have been input.I think this is due to enumerateCredentialsGetNextCredential and enumerateRPsGetNextRP being statefull in the fido v2.1 spec.